import React, { Fragment } from 'react';
import RouteRender from './RouteRender';
import SpaceWrapper from './SpaceWrapper';

/**
 * 数组
 * @param param0
 * @returns
 */
export default function ArrayRender(_ref) {
  var data = _ref.data,
    _ref$depth = _ref.depth,
    depth = _ref$depth === void 0 ? 0 : _ref$depth;
  return /*#__PURE__*/ React.createElement(
    Fragment,
    null,
    '[',
    data.length ? /*#__PURE__*/ React.createElement('br', null) : null,
    data.map(function (item, index) {
      return /*#__PURE__*/ React.createElement(
        Fragment,
        {
          key: index,
        },
        /*#__PURE__*/ React.createElement(RouteRender, {
          data: item,
          depth: depth + 1,
        }),
        index === data.length - 1 ? null : ',',
        /*#__PURE__*/ React.createElement('br', null),
      );
    }),
    /*#__PURE__*/ React.createElement(
      SpaceWrapper,
      {
        depth: depth,
      },
      ']',
    ),
  );
}
